package com.dnjn.happiness.oss.controller;

import com.dnjn.happiness.oss.service.UploadService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

@Deprecated
@RestController
@RequestMapping("/upload")
public class UploadController {

    @Autowired
    UploadService uploadService;

    /**
     * 文件上传
     */
    @PostMapping("/img")
    public String uploadImage(MultipartFile file) {
        String path = uploadService.uploadImage(file);
        return path;
    }
}
